import request from '@/plugin/axios'
export function getAreaTree() {
    return request({
        url: '/bdms/area/tree',
        method: 'get',
        params: request.adornParams()
    })
}
// export function getAreaTreeChild() {
//     return request({
//         url: '/bdms/area/treeChild',
//         method: 'get',
//         interfaceCheck: false,
//         loading: {
//             type: 'loading',
//             options: {
//             }
//         }
//     })
// }
/**
 * 获取国家列表字典
 */
export function getAreaList() {
    return request({
        url: '/bdms/area/list',
        method: 'get',
    })
}
/**
 * 获取省市列表字典
 */
export function getAreaCountryDict() {
    return request({
        url: '/bdms/area/country/dict',
        method: 'get',
    })
}

export function getAreaCityDict() {
    return request({
        url: '/bdms/area/city/dict',
        method: 'get',
    })
}

export function getAreaQueryList(query) {
    return request({
        url: '/bdms/area/queryList',
        method: 'get',
        params: query
    })
}
export function getArea(id) {
    return request({
        url: '/bdms/area/info/' + id,
        method: 'get'
    })
}
export function saveArea(data) {
    return request({
        url: '/bdms/area/save',
        method: 'post',
        data
    })
}


export function updateArea(data) {
    return request({
        url: '/bdms/area/update',
        method: 'put',
        data
    })
}
export function delArea(id) {
    return request({
        url: '/bdms/area/delete/' + id,
        method: 'delete'
    })
}

export function getAreaListByParentId(parentId) {
    return request({
        url: '/bdms/area/getAreaListByParentId/' + parentId,
        method: 'get'
    })
}

export function getProvinceList() {
    return request({
        url: '/bdms/area/getProvinceList',
        method: 'get'
    })
}

//获取二级区域树数据
export function getAreaSecondLevelTreeList() {
    return request({
        url: '/bdms/area/getAreaSecondLevelTreeList',
        method: 'get'
    })
}